<?php 
class Text extends IController{
	public function add(){
		$this->redirect("add");
	}
	public function adddo(){
		$model=new IModel('mhf');
		$name=IReq::get('name','post');
		$pwd=IReq::get('pwd','post');
		$rname=IReq::get('rname','post');
		$gz=IReq::get('gz','post');
		$data=array('name'=>$name,'pwd'=>$pwd,'rname'=>$rname,'gz'=>$gz);
		$model->setData($data);
		$res=$model->add();
		if($res){
			$this->redirect("show");
		}
	}
	public function show(){
		$model=new IModel('mhf');
		$data=$model->query();
		$this->data=$data;
		$this->setRenderData("$data");
		$this->redirect("show");
	}
	public function del(){
		$model=new IModel('test');
		$id=IReq::get('id');
		$res=$model->del('id='.$id);
		if($res){
			$this->redirect("show");
		}
	}
	public function upd(){
		$model=new IModel('test');
		$id=IReq::get('id');
		$data=$model->query('id='.$id);
		// print_r($data);die;
		$this->data=$data;
		$this->setRenderData("$data");
		$this->redirect("upddo");

	}
	// public function  test(){
	// 	$ak="KYwYs1S40IiOXidwZMtTwZHASn4H9UFF";
	// 	$url="http://api.map.baidu.com/api?v=2.0&ak=";
	// }
	
	public function ditu(){
		$this->redirect("ditu");
	}
	public function logindo(){
		$this->redirect("logindo");
	}
	public function qq_login(){
		$appid='101353491';			// APPID
		$appkey='df4e46ba7da52f787c6e3336d30526e4';			// APPKEY
		$redirect_uri='http://www.iwebshop.com/index.php';
		$state=rand(1000,9999);
		$url="https://graph.qq.com/oauth2.0/authorize?response_type=code&client_id=$appid&redirect_uri=$redirect_uri&state=$state";
		header("Location:$url");
	}
	public function denglu(){
		$this->redirect("denglu");
	}
	// public function login_a(){
	// 	$appid='101353491';			// APPID
	// 	$appkey='df4e46ba7da52f787c6e3336d30526e4';			// APPKEY
	// 	$redirect_uri='http://www.iwebshop.com/index.php';
	// 	$state=rand(1000,9999);
	// 	$url=" https://graph.qq.com/oauth2.0/authorize?response_type=code&client_id=$appid&redirect_uri=$redirect_uri&state=$state";
	// 	header("Location:$url");
	// }
	// public function qqdl(){
	// 	$appid='101353491';			// APPID
	// 	$appkey='df4e46ba7da52f787c6e3336d30526e4';			// APPKEY
	// 	$redirect_uri='http://www.iwebshop.com/index.php';
	// 	$state=rand(1000,9999);
	// 	$url=" https://graph.qq.com/oauth2.0/authorize?response_type=code&client_id=$appid&redirect_uri=$redirect_uri&state=$state";
	// 	header("location:$url");
	// }
	
	public function qqlogin(){
		$this->redirect("qqlogin");
	}
	public function logina(){
		$appid='101353491';			// APPID
		$appkey='df4e46ba7da52f787c6e3336d30526e4';			// APPKEY
		$redirect_uri='http://www.iwebshop.com/index.php';
		$state=rand(1000,9999);
		$url="https://graph.qq.com/oauth2.0/authorize?response_type=code&client_id=$appid&redirect_uri=$redirect_uri&state=$state";
		header("location:$url");
	}


























	
}
?>









